<?php
header("content-type:text/html;charset=utf-8");
include "../../public/config/config.php";
include "../../public/include/funcs.php";
$self=substr($_SERVER['PHP_SELF'], strrpos($_SERVER['PHP_SELF'], '/')+1);
$link=conn($cfg_dbhost,$cfg_dbuser,$cfg_dbpwd,$cfg_dbname,$cfg_dbchar);

$id=$_GET['id'];
$type_arr=select($link, "tel_type","id=$id");
$path="../../files/tel/".$type_arr[0]['image'];
if(file_exists($path)){
	$unlink=unlink($path);
}
$re_del_tel=del($link, "tels","tid=$id");
if($re_del_tel){
	$re_del_type=del($link, "tel_type","id=$id");
	if($re_del_type){
		echo "<script>";
		echo "alert('删除成功！');";
		echo "window.location.href='index.php';";
		echo "</script>";
	}
}

?>
